#include "script/glue/LuaGlue.h"

#include <OgreOverlayManager.h>
#include <OgreOverlay.h>

namespace LuaGlue
{
	int Overlay::create(lua_State *L)
	{
		Ogre::Overlay *ov = NULL;
		std::string name = "Overlay";
		
		switch(lua_gettop(L))
			{
			case 0:
				break;
			case 1:
				name = luaL_checkstring(L, 1);
				break;
			default:
				luaL_error(L, "Incorrect number of arguments for function");
				return 0;
			}

		Ogre::OverlayManager& olm = Ogre::OverlayManager::getSingleton();
		ov = olm.create(name);

		Wrapper<Overlay>::Instance(L, (void*)ov);

		return 1;
	}
}

DECLARE(Overlay)
META(Overlay)
METHODS(Overlay)
END
